export const formComponentConfig = {
  selectLike: () =>
    import('@/views/purchase-demand/components/formComp/selectLike.vue'),
  supplyName: () => import('@/common/components/search-modal/supplyName.vue'),
  user: () => import('@/common/components/search-modal/user.vue'),
  dictSelect: () => import('@/common/components/dict-select/index.vue'),
};

export const formRenderConfig = (
  contractCodeValue: string,
  supplierValue: string
) => {
  return {
    planListNo: {
      label: '计划编号',
      field: 'planListNo',
      componentName: 'input',
    },
    contractCode: {
      label: '合同号',
      field: 'contractCode',
      value: contractCodeValue,
      componentName: 'input',
      componentProps: {
        disabled: !!contractCodeValue,
      },
    },
    supplierName: {
      label: '供应商名称',
      field: 'supplierName',
      value: supplierValue,
      componentName: 'input',
      componentProps: {
        disabled: !!contractCodeValue,
      },
    },
    materialCode: {
      label: '物料编码',
      field: 'materialCode',
      componentName: 'inputModal',
      componentProps: {
        title: '物料编码',
        type: 'materialCode',
        valueName: 'materialCode',
        labelName: 'materialName',
      },
    },
    planArrivalDate: {
      label: '交货时间',
      field: 'planArrivalDate',
      componentName: 'rangPicker',
    },
    like: {
      label: '喜欢',
      field: 'like',
      componentName: 'selectLike',
      componentProps: {},
    },
  };
};
